`:top
The `!Text Object Model`! (`!TOM`!) is a `F33f`_`[Microsoft Windows`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Microsoft_Windows]`_`f `F33f`_`[API`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Application_Programming_Interface]`_`f that provides developers with object-based rich text manipulation interfaces. It is implemented through `F33f`_`[COM`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Component_Object_Model]`_`f, and can be accessed through `F33f`_`[Microsoft Word`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Microsoft_Word]`_`f or additionally through the RichEdit controls that normally ship with Windows.`:cite-ref-tom-msdn-1-0[`F5bf`_`[1`#cite-note-tom-msdn-1]`_`f]
>>Contents
• `F0af`_`[History`#history]`_`f
• `F0af`_`[Technical details`#technical-details]`_`f
• `F0af`_`[COM Interfaces`#com-interfaces]`_`f
• `F0af`_`[See also`#see-also]`_`f
• `F0af`_`[References`#references]`_`f
• `F0af`_`[External links`#external-links]`_`f
-─
>>History
When TOM was developed, it was influenced heavily by WordBasic,`:cite-ref-tom-msdn-1-1[`F5bf`_`[1`#cite-note-tom-msdn-1]`_`f] a `F33f`_`[macro language`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Macro_language]`_`f used within Word before `F33f`_`[VBA`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Visual_Basic_for_Applications]`_`f (`F33f`_`[Word 95`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Microsoft_Word]`_`f and previous releases). TOM has developed alongside the RichEdit technology, and has been present since version 1.0 of the RichEdit components.`:cite-ref-richedit-2006-2-0[`F5bf`_`[2`#cite-note-richedit-2006-2]`_`f] The API has been available as an option for `F33f`_`[Windows CE`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Windows_CE]`_`f since the 2.5 release of RichEdit (Western Languages Only), which was at least used by `F33f`_`[Pocket Word`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Microsoft_Office_Mobile]`_`f at that time.`:cite-ref-richedit-2006-2-1[`F5bf`_`[2`#cite-note-richedit-2006-2]`_`f]
Version 8.0 of RichEdit, which shipped with `F33f`_`[Windows 8`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Windows_8]`_`f, added support for `F33f`_`[OpenType math`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=OpenType_math]`_`f.`:cite-ref-3[`F5bf`_`[3`#cite-note-3]`_`f]
>>Technical details
To retrieve an implemented instance of `B100`F9d9ITextDocument`f`b `F33f`_`[interface`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Interface_(object-oriented_programming)]`_`f (the top-level document interface), the `B100`F9d9EM_GETOLEINTERFACE`f`b message may be sent via the SendMessage API to obtain a pointer to an `B100`F9d9IRichEditOle`f`b object, which also implements the `B100`F9d9ITextDocument`f`b interface.`:cite-ref-tom-msdn-1-2[`F5bf`_`[1`#cite-note-tom-msdn-1]`_`f] TOM may operate differently depending on the version of the RichEdit control the interface is retrieved for (RICHEDIT50W windows provide more functionality than the standard RICHEDIT20W or RICHEDIT20A controls, like proper table support).`:cite-ref-richedit-2006-2-2[`F5bf`_`[2`#cite-note-richedit-2006-2]`_`f]
>>>COM Interfaces
`!ITextDocument`!
A top-level interface. Documents may be opened and saved through this interface. Some screen update control is achieved here as well. Undo/redo grouping is implemented here. Arbitrary text ranges (`!ITextRange`!) and a text range for currently selected text (`!ITextSelection`!) are provided, which are used to modify or review the document.
`!ITextRange`!
Provides editing and data-binding tools to select text within a document, that can be examined, modified, or removed. Ranges exist within paragraphs, and the paragraph a range is within is accessible through a property of this object. ITextSelection Provides selection information, in addition to functionality provided by the `!ITextRange`!.
`!ITextFont`!
Dual Interface with `!ITextPara`!
A mechanism for inspection and modification of rich edit font attributes, that is considerably more extensive that the standard OLE interface used to describe a font (IFontDisp, StdFont).
`!ITextPara`!
Dual Interface with `!ITextFont`!
Provides extensive information about the position, formatting outside of fonts (e.g. first line indent), behavior (e.g. widow control), and purpose of a paragraph (it could be a normal paragraph, a list, a table, etc).
>>See also
• `F33f`_`[Rich Text Format`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Rich_Text_Format]`_`f
• `F33f`_`[Component Object Model`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Component_Object_Model]`_`f (COM)
• `F33f`_`[Object Linking and Embedding`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Object_Linking_and_Embedding]`_`f (OLE)
>>References
`:cite-note-tom-msdn-1`!1.`! `F0af`_`[↑`#cite-ref-tom-msdn-1-0]`_`f "Text Object Model". Retrieved 2011-12-04.
`:cite-note-richedit-2006-2`!2.`! `F0af`_`[↑`#cite-ref-richedit-2006-2-0]`_`f "RichEdit versions". 13 October 2006. Retrieved 2023-11-19.
`:cite-note-3`!3.`! `F0af`_`[↑`#cite-ref-3]`_`f "DevBlogs".
>>External links
• Text Object Model Overview
• Obtaining the TOM Object for a RichEdit Control
• Historical RichEdit/TOM information (WebArchive link)
• TOM Classes for .NET
`c`F0af`_`[↑ Back to top`#top]`_`f`a